#pragma once
#include "Texture.h"
#include "Input.h"
#include "DX9Engine.h"

#define MENU_BUTCNT 5	// Menu button count
#define IGMU_BUTCNT 3	// In game menu button count
#define NUM_BUTTONS MENU_BUTCNT+IGMU_BUTCNT // total button count

/** User Interface States
* {MENU, IGMENU, NONE}
*/
enum UIState {UI_MENU, UI_INGAME, UI_NONE};

class UserInterface
{
private:
	Input* pInput;
	DX9Engine* pEngine;
	Texture window;
	Texture border;
	Texture menuButton[MENU_BUTCNT];
	Texture gameButton[IGMU_BUTCNT];
	RECT borderRect[NUM_BUTTONS];
	UIState state;
	bool mbdown[MAX_MOUSEBUT];
	bool resume;
public:
	UserInterface(void);
	~UserInterface(void);
	/** Initialize UI */
	void initialize();
	/** Update UI */
	void update();
	/** Render UI */
	void render();
	/** Draw UI Text */
	void drawText();
	/** Change UI State
	 * @param UIState to set UI state
	 */
	void setState(UIState s);
	/** Get UI State
	 * 0 = UI_MENU
	 * 1 = UI_INGAME
	 * 2 = UI_NONE
	 */
	int getState();
	/** Check if UI is unpaused */
	bool isResumed();
	/** UI release */
	void release();
};